package com.rao.quartz.service.serviceImpl;

import com.rao.entity.User;
import com.rao.quartz.mapper.UserMapper;
import com.rao.quartz.service.serviceInterface.UserServiceSecond;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: raoguang
 * @Date: 2022/06/15/0:31
 * @Description:
 */
@Service
public class UserServiceSecondImpl implements UserServiceSecond {

    @Autowired
    private UserMapper userMapper;

    @Override
    public boolean updateUserInfo(int userId, User userInfo) {
        return userMapper.updateUserInfo(userId, userInfo);
    }

    @Override
    @Transactional
    public User methodC() {
        //先修改name=“饶大大” pwd="1999"
        User user = new User();
        user.setId("1");
        user.setName("饶4444");
        user.setPwd("4444");
        //第一次修改
        updateUserInfo(Integer.parseInt(user.getId()), user);
        int i = 1 / 0;
        return null;
    }
}
